#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int removeDuplicates(int* nums, int numsSize) {
    int src = 1;
    int dst = 0;
    while (src < numsSize)
    {
        if (nums[dst] == nums[src])
        {
            src++;
        }
        else
        {
            dst++;
            nums[dst] = nums[src];
            src++;
        }
    }
    return dst + 1;
}
int main()
{
    int nums[10] = {0, 0, 1, 1, 1, 2, 2, 3, 3, 4};
    int a = removeDuplicates(nums, 10);

    for (int i = 0; i < a; i++)
    {
        printf("%d ", nums[i]);
    }
    return 0;
}